// NwRulerX.cpp : implementation file
//

#include "stdafx.h"
//#include "BTSDA.h"
#include "NwRulerY.h"


// CNwRulerX
namespace NS_GXX_GRAPH
{
	IMPLEMENT_DYNAMIC(CNwRulerY, CNwRuler)

		CNwRulerY::CNwRulerY()
	{
		m_titleFont.CreateFont(
			12,                        // nHeight
			0,                         // nWidth
			0,                         // nEscapement
			0,                         // nOrientation
			FW_NORMAL,                 // nWeight
			FALSE,                     // bItalic
			FALSE,                     // bUnderline
			0,                         // cStrikeOut
			ANSI_CHARSET,              // nCharSet
			OUT_DEFAULT_PRECIS,        // nOutPrecision
			CLIP_DEFAULT_PRECIS,       // nClipPrecision
			DEFAULT_QUALITY,           // nQuality
			DEFAULT_PITCH | FF_SWISS,  // nPitchAndFamily
			L"Arial");
	}

	CNwRulerY::~CNwRulerY()
	{
	}


	BEGIN_MESSAGE_MAP(CNwRulerY, CNwRuler)
		ON_WM_CREATE()
	END_MESSAGE_MAP()

	void CNwRulerY::OnDraw(CDC *pDC)
	{
		CNwRuler::OnDraw(pDC);
		CRect rcClient;
		GetClientRect(rcClient);

		CRect rcTest(0, 0, rcClient.right, RULER_TITLE_TEXT_HEIGHT);
		CRect rcText = m_rcZoom;
		rcText.top += m_rcZoom.Height();
		rcText.bottom += m_rcZoom.Height();
		HFONT hOldFont;
		hOldFont = (HFONT)pDC->SelectObject(m_titleFont);
		pDC->SetTextColor(m_clrScalText);

		if (rsLeft == m_rsStyle)
		{
			pDC->DrawText(m_strRulerTitle, rcTest, DT_RIGHT | DT_VCENTER);
		}
		else //if (rsRight == m_rsStyle)
		{
			pDC->DrawText(m_strRulerTitle, rcTest, DT_LEFT | DT_VCENTER);
		}

		pDC->SelectObject(hOldFont);
	}

	// CNwRulerX message handlers



	int CNwRulerY::OnCreate(LPCREATESTRUCT lpCreateStruct)
	{
		if (CNwRuler::OnCreate(lpCreateStruct) == -1)
			return -1;

		//CString str = g_Setting->GetLangText("graph", "ShowCurve");
		//m_menu.ModifyMenu(ID_MenuRuler_ShowAll,MF_BYCOMMAND|MF_STRING|MF_GRAYED,ID_MenuRuler_ShowAll,str);

		//str = g_Setting->GetLangText("graph", "HideCurve");
		//m_menu.ModifyMenu(ID_MenuRuler_HideAll,MF_BYCOMMAND|MF_STRING|MF_GRAYED,ID_MenuRuler_HideAll, str);
		return 0;
	}


}

